package com.renjibo.sharkerwave.ui.fragment;


import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.renjibo.sharkerwave.R;
import com.renjibo.sharkerwave.ui.activity.LoginActivity;
import com.renjibo.sharkerwave.utils.ShowHideTop;

/**
 * 我的页面
 */
public class MyFragment extends BaseFragment implements View.OnClickListener {
    private static final String ARG_PARAM1 = "param1";
    private static final String ARG_PARAM2 = "param2";

    private String mParam1;
    private String mParam2;


    public MyFragment() {
    }


    public static MyFragment newInstance(String param1, String param2) {
        MyFragment fragment = new MyFragment();
        Bundle args = new Bundle();
        args.putString(ARG_PARAM1, param1);
        args.putString(ARG_PARAM2, param2);
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
            mParam1 = getArguments().getString(ARG_PARAM1);
            mParam2 = getArguments().getString(ARG_PARAM2);
        }
        ShowHideTop.setWindow(getActivity(), false);
    }

    @Override
    public void onResume() {
        super.onResume();
        ShowHideTop.setWindow(getActivity(), false);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_my, container, false);
        initView(view);
        return view;
    }

    private void initView(View view) {
        view.findViewById(R.id.my_text_image_my_download).setOnClickListener(this);
        view.findViewById(R.id.my_text_image_my_collection).setOnClickListener(this);
        view.findViewById(R.id.my_autoRelative_account_money).setOnClickListener(this);
        view.findViewById(R.id.my_text_image_purchase_history).setOnClickListener(this);
        view.findViewById(R.id.my_text_image_message_center).setOnClickListener(this);
        view.findViewById(R.id.my_text_image_set_up).setOnClickListener(this);
        view.findViewById(R.id.my_text_image_user_phone).setOnClickListener(this);
        view.findViewById(R.id.my_autoRelative_head).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            //我的下载
            case R.id.my_text_image_my_download:
                break;
            //我的收藏
            case R.id.my_text_image_my_collection:
                break;
            //账户余额
            case R.id.my_autoRelative_account_money:
                break;
            //购买记录
            case R.id.my_text_image_purchase_history:
                break;
            //消息中心
            case R.id.my_text_image_message_center:
                break;
            //设置
            case R.id.my_text_image_set_up:
                break;
            //客服电话
            case R.id.my_text_image_user_phone:
                break;
            //登录
            case R.id.my_autoRelative_head:
                Intent intent=new Intent(getActivity(), LoginActivity.class);
                startActivity(intent);
                break;
        }
    }
}
